home *** CD-ROM | disk | FTP | other *** search
- /************************************************************************************/
- /* PlaceAlert */
- /* */
- /* Loads the alert template into memory, and resets the value of the bounds rect */
- /* to position it on the screen. */
- /* */
- /************************************************************************************/
-
- #include "MyHeaders.h"
-
- short PlaceAlert(short alrtNo)
- {
- short PARetCode = 0; /* set return code */
- Rect saveRect; /* work area */
- short rectHeight;
- short rectWidth;
- short newH, newV;
-
- myATmplH = (AlertTemplate **) GetResource ('ALRT', alrtNo);
- if (ResError() != noErr)
- PARetCode = 1;
- else
- {
- HNoPurge((Handle) myATmplH); /* make not purgeable */
- saveRect = (**myATmplH).boundsRect; /* save the current value */
- rectHeight = saveRect.bottom - saveRect.top;
- rectWidth = saveRect.right - saveRect.left;
-
-
- newH = (screenBits.bounds.right - rectWidth) * .50; /* new left */
- if (newH < 9)
- newH = 9; /* not off screen */
-
- newV = ((screenBits.bounds.bottom - 29 - rectHeight) * (.20)) + 29; /* top */
- if (newV < 29)
- newV = 29; /* not into menu bar */
-
- SetRect (&(**myATmplH).boundsRect, newH, newV,
- (newH + rectWidth), (newV + rectHeight));
-
- HPurge ((Handle) myATmplH); /* make purgeable again */
-
- CursorSelect (NIL, NIL, NIL);
- }
-
- return PARetCode;
- }
-